/**
 *
 */
package com.wedroid.r2d2.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.demo2do.core.persistence.GenericJdbcSupport;
import com.wedroid.entity.message.Message;

/**
 * @author lute
 */
@Repository
public class MessageDaoSupport {

    @Autowired
    private GenericJdbcSupport genericJdbcSupport;

    /**
     * @param message
     */
    public void creatMessage(Message message) {
        String sentence = "INSERT INTO message (msg_id, message_type, message_time, content, sender_id, sender_name, receiver_id, receiver_name, group_member_id, group_member_name, droid_id) VALUES (:msgId, :messageType, :messageTime, :content, :sender.id, :senderName, :receiver.id, :receiverName, :groupMember.id, :groupMemberName, :droid.id)";
        genericJdbcSupport.save(sentence, message);
    }

}
